/**
 * Created by imouze on 2017-10-31.
 */
module.exports = function() {
    return async (ctx, next) => {
        const start = Date.now();
        console.log(`Process ${ctx.request.method} ${ctx.request.url}...`);
        await next();
        const ms = Date.now() - start;
        console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
    }
};